home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act8 / 00074.ls < prev    next >
Encoding:
Text File  |  1995-03-28  |  12.0 KB  |  122 lines

  1. on smove sold, stime, xdest, ydest
  2.   global diffx, diffy
  3.   set sx to the locH of sprite sold
  4.   set sy to the locV of sprite sold
  5.   set diffx to xdest - sx
  6.   set diffy to ydest - sy
  7.   if abs(diffx) < 25 then
  8.     set diffx to 0
  9.   end if
  10.   if abs(diffy) < 25 then
  11.     set diffy to 0
  12.   end if
  13.   set carnum to "car" & sign(diffx) & "." & sign(diffy)
  14.   set the castNum of sprite 25 to the number of cast carnum
  15.   set incx to ((1.0 * xdest) - sx) / stime
  16.   set incy to ((1.0 * ydest) - sy) / stime
  17.   startTimer()
  18.   repeat while the timer < stime
  19.     set ptime to the timer
  20.     set the locH of sprite sold to sx + (incx * ptime)
  21.     set the locV of sprite sold to sy + (incy * ptime)
  22.     updateStage()
  23.   end repeat
  24.   set the locH of sprite sold to xdest
  25.   set the locV of sprite sold to ydest
  26.   updateStage()
  27. end
  28.  
  29. on stopMovie
  30.   puppetSound(0)
  31. end
  32.  
  33. on startMovie
  34.   global foillist, linklist, instruct8, hylist, lowlist, ogre
  35.   set ogre to 0
  36.   set hylist to []
  37.   set lowlist to []
  38.   repeat with xxx = 1 to 10
  39.     add(hylist, the number of cast ("diga" & xxx))
  40.     add(lowlist, the number of cast ("dig" & xxx))
  41.   end repeat
  42.   set instruct8 to 0
  43.   set foillist to [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, -4, 4, 3, 6, 5, 6, -7, -7, -8], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -4, 5, -5, -5, 3, 4, 6, -7, 3, 2], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 4, -6, -5, 4, -6, -6, 4, 4, 5, 3], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -7, 6, -5, 6, 3, -6, 4, 5, 4, -8], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -3, 4, 3, 2, 5, 4, -5, -7, -6, -4], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 6, 7, 6, -9, 8, -8, -9, 7, -8, -7], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 6, 5, 8, 9, -3, -10, -8, -7, 6, 2], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -6, -8, 5, 4, 7, -6, 8, -9, 6, 3], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 4, -4, 7, 4, -5, 2, -5, 3, -9, -8], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -5, 3, -5, 2, 5, 4, -4, -8, 6, 7], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 6, 5, 5, 3, 8, 6, 7, 4, -9, -7], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 4, 4, 3, 5, -6, -6, -6, -7, -8], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -5, 4, 4, -5, -6, 3, 5, -6, 4, 2], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -3, -4, 5, 4, -7, -5, -6, 4, 3, 3], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -7, 7, 6, 8, -8, 3, 4, -4, 5, -9], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 4, 5, -7, 2, 6, -8, -6, -7, -3, -3], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 6, -8, -6, 5, 10, 7, 9, -8, 5, -7], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -7, 2, 6, -7, 6, -8, 5, 7, -3, 6], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 4, 5, 6, 5, 3, -6, -7, -6, -4, 3], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -5, 4, 6, -4, -9, 3, -5, -2, -8, 7], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -3, 4, -4, 3, 8, 7, 5, -6, -9, -6], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 8, -10, 6, 5, -8, 7, 9, 7, 9, -3], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, -6, 4, 3, 5, 9, -4, 7, -10, -8], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, -7, 5, 5, -5, 4, -6, 4, 3, 2], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -3, -3, 8, 8, 9, -10, 6, 7, -3, -9], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -5, 5, 4, -6, 7, 4, 3, 6, -4, -8], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, 4, -6, -3, 5, -8, 5, -6, -9, 2], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 7, 8, 6, 5, -9, 5, -9, -7, 6, -7], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -7, 2, 6, -4, 5, -8, 5, 7, 3, -6], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 7, 8, -10, 6, -4, -6, 4, -10, 5, 9], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -3, 7, -5, -5, -8, 8, 6, 5, -9, 4], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 3, -1, -4, -3, 9, -5, 8, -7, 8, 4], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 5, 7, 4, 8, 9, -10, -6, 6, 5, 3]]
  44.   set linklist to [[[2], [1, 3, 11, 14], [4, 2], [5, 3], [4, 6], [5, 12, 7], [6, 8], [18, 9, 7], [8, 10], [], [2, 12], [11, 6, 17], [14, 16], [13, 2], [16, 19, 18], [17, 13, 15], [2, 12], [15, 20, 8], [15, 10], [18, 10]], [[2, 20], [3, 1], [4, 2], [13, 5, 12, 3], [4, 6], [7, 5], [8, 13, 6], [9, 14, 7], [10, 8], [], [14, 16, 19], [4, 17], [7, 4], [11, 8], [16, 20], [11, 15], [18, 12], [10, 17], [11, 20], [19, 1, 15]], [[2], [3, 11, 17, 20], [14, 4, 2], [16, 3, 5], [13, 4, 6], [7, 5], [15, 6, 8], [9, 7], [10, 8], [], [19, 2], [17, 18, 10], [14, 5], [13, 3], [19, 7], [4, 19], [2, 12], [20, 12], [11, 16, 12, 15], [2, 18]], [[2], [15, 3, 1], [4, 19, 2], [5, 3], [6, 11, 4], [7, 5, 16], [6, 8, 14], [9, 7], [10, 8], [], [5, 12, 20], [11, 18], [14, 16, 17], [7, 13], [17, 2, 16], [13, 6, 15], [13, 15], [12, 19], [18, 3], [10, 11]], [[14, 2], [1, 3, 11], [4, 2, 12], [3, 5], [4, 20, 6], [5, 7, 18], [6, 8], [7, 9], [8, 10], [], [2, 13], [3, 17], [11, 20, 14, 16], [1, 13], [16, 19], [13, 15], [12, 8], [6, 10, 10], [15, 10], [13, 5], []], [[2], [1, 3], [2, 4], [3, 5], [11, 4, 6, 13], [5, 7], [6, 8], [7, 18, 9], [14, 8, 16, 10], [9, 19, 17], [5, 20], [13, 19], [20, 5, 12], [9, 19], [16, 17], [18, 9, 15], [15, 10], [8, 16], [12, 10, 14], [11, 13], []], [[2, 20], [3, 1], [4, 2], [5, 12, 3], [11, 6, 4], [7, 15, 5], [8, 13, 6], [9, 7], [10, 8], [], [17, 5], [19, 4], [14, 7], [16, 13], [6, 20], [14, 10], [11, 10], [10, 19], [18, 12], [15, 1], []], [[2], [20, 3, 12], [2, 4], [3, 5], [11, 4, 6], [5, 7], [8, 6], [9, 8, 7, 18], [10, 8], [], [5, 10], [2, 10], [14, 16, 19], [20, 13], [19, 17], [13, 10], [15, 18], [17, 8], [13, 15], [2, 14], []], [[16, 2], [1, 3], [2, 12, 4], [3, 5], [4, 6], [5, 7, 13], [12, 6, 8], [17, 7, 9], [10, 8, 20], [], [18, 17, 15], [18, 3, 7], [6, 20], [16, 15], [10, 14, 11], [1, 18, 14], [11, 8], [16, 12, 11], [10, 20], [9, 19, 13], []], [[2], [1, 3, 11, 14], [2, 4], [3, 13, 5], [4, 6], [5, 7], [6, 8], [9, 7, 18], [10, 17, 8], [], [2, 10], [14, 14, 16], [4, 10], [2, 12], [16, 19], [12, 15, 18], [12, 10], [8, 16, 20], [15, 20], [19, 18], []], [[2], [3, 14, 1], [4, 2], [13, 10, 5, 3], [6, 4], [7, 5, 20], [8, 6], [9, 7, 19], [8, 10], [], [20, 12], [11, 18], [16, 4], [2, 18, 18], [17, 19], [17, 13], [15, 16], [12, 14], [15, 8], [6, 11], []], [[2], [14, 1, 3, 11], [2, 4], [3, 5], [6, 17, 4], [5, 7, 19], [6, 20, 8], [16, 7, 9], [8, 10], [], [2, 12], [17, 11, 18], [14, 15], [2, 13], [13, 18], [18, 8], [12, 5], [15, 12, 16], [6, 10], [7, 10], []], [[2, 20], [3, 1], [19, 4, 2], [5, 3], [6, 4], [7, 11, 5], [8, 6], [9, 14, 7], [10, 8], [], [15, 19, 6], [17, 16], [14, 16], [8, 13, 16], [10, 11], [12, 14, 13, 20], [18, 12], [10, 17], [11, 3], [16, 16, 1], []], [[2], [19, 3, 11, 20, 1], [2, 4, 4], [12, 3, 5, 10], [11, 16, 4, 6], [5, 7], [15, 6, 8], [7, 9], [10, 8], [], [2, 5], [19, 4], [14, 17], [13, 20], [17, 7], [18, 5], [18, 15, 13], [20, 16, 17], [2, 12], [2, 14, 18], []], [[2], [3, 16, 1], [18, 2, 4], [5, 3], [6, 11, 4], [7, 18, 5], [8, 15, 6], [9, 7, 11], [10, 8], [], [8, 5], [14, 13], [12, 19], [20, 15, 12], [7, 14, 16], [2, 15, 17], [16, 19], [6, 3], [13, 17], [10, 14], []], [[14, 2], [1, 19, 3], [2, 4, 11], [3, 5], [4, 6, 15], [19, 20, 5, 7], [6, 8], [7, 9], [8, 10], [9, 16, 18], [3, 12], [11, 17], [15, 17, 16], [20, 1], [5, 13, 18], [13, 10, 10], [13, 12], [15, 10], [2, 6], [14, 6], []], [[2], [1, 3], [2, 4], [19, 5, 3, 14], [20, 6, 4], [5, 7], [6, 8, 12], [7, 9], [13, 18, 8, 10], [12, 9, 15], [19, 20], [7, 10], [14, 9, 16], [4, 13], [10, 17], [13, 18], [18, 15], [16, 17, 9], [11, 4], [11, 5], []], [[2, 12], [3, 1], [4, 2], [17, 3, 5], [13, 4, 6], [7, 5, 19], [8, 6], [9, 7], [10, 8], [], [10, 13], [19, 1], [11, 5], [15, 10], [14, 17], [10, 18], [4, 16, 20], [16, 20], [6, 12], [18, 17], []], [[2], [20, 1, 15, 3], [2, 4], [3, 5, 14], [4, 6], [5, 7], [6, 8], [9, 18, 7], [10, 8], [], [20, 12], [11, 13, 18], [17, 12], [4, 16], [2, 19], [14, 10], [13, 10], [12, 8], [15, 10], [2, 11], []], [[18, 2], [1, 3], [2, 4, 12], [3, 5, 11], [18, 4, 6], [5, 7, 14], [6, 8], [11, 7, 9], [8, 19, 10], [], [4, 8, 13], [3, 17], [17, 11, 20], [16, 10, 6], [10, 19], [18, 14], [12, 13], [1, 5], [9, 15, 20], [13], []], [[2], [1, 3, 11, 14], [2, 4], [3, 5], [4, 20, 6], [5, 7, 16], [6, 19, 8], [9, 18, 7], [10, 8], [11, 13, 20, 9], [2, 10], [14, 17], [14, 10], [2, 12, 13], [16, 19], [6, 15], [12, 18], [17, 8], [7, 15], [5, 10], []], [[2], [20, 3, 1], [4, 2], [5, 3], [6, 4], [18, 5, 7], [6, 8], [7, 9], [8, 10, 20, 13], [12, 9], [18, 19], [19, 10], [14, 9], [17, 13], [19, 16], [15, 17], [16, 14], [6, 11], [11, 12, 15], [9, 2], []], [[2], [14, 3, 11, 1], [2, 4], [3, 5], [4, 12, 6], [5, 7], [17, 6, 8], [7, 16, 9], [8, 10], [], [2, 17], [15, 5, 18], [14, 15], [2, 13], [13, 12], [8, 18, 19], [11, 7], [12, 16, 20], [16, 10], [18, 10], []], [[20, 2], [3, 1], [4, 2], [13, 14, 5, 3], [6, 4], [7, 5], [8, 6], [9, 7], [10, 8], [], [18, 20], [17, 18, 10], [17, 4], [17, 4], [16, 10], [15, 19], [12, 14], [19, 11, 12], [16, 18, 20], [19, 11, 1], []], [[2], [1, 3, 11, 12, 19], [2, 6, 4], [3, 5], [4, 6, 17], [3, 5, 7], [6, 8], [11, 7, 20, 9], [12, 19, 8, 10], [], [2, 8], [2, 9], [18, 15], [20, 18], [16, 13], [10, 15], [5, 18], [14, 17, 13], [2, 9], [8, 14], []], [[2], [3, 17, 1], [4, 2, 16], [5, 3], [6, 4, 11], [15, 7, 5], [8, 6, 19], [9, 14, 7], [10, 8], [], [18, 5, 16], [14, 13], [17, 12], [8, 12], [20, 6, 18], [11, 3], [19, 13, 2], [15, 11], [7, 17], [10, 15], []], [[2, 20], [1, 3], [2, 4], [3, 15, 5], [4, 6], [5, 7, 19], [6, 8, 16], [13, 7, 9], [8, 10, 16], [], [20, 12, 19], [11, 17], [8], [20, 4], [4, 18], [7, 9], [12, 13, 13], [15, 10], [11, 6], [1, 14, 11], []], [[2], [1, 3], [2, 4], [16, 3, 5, 14], [4, 6], [5, 7, 18], [17, 6, 8, 10], [18, 7, 9], [10, 8], [15, 7, 9], [13, 12], [11, 15, 17], [20, 11], [13, 4], [12, 10], [19, 4], [7, 12], [6, 8], [16, 20], [19, 13], []], [[12, 2], [3, 1], [4, 2], [5, 15, 3], [6, 4], [7, 18, 5], [8, 6], [9, 7], [8, 10], [], [10, 13], [19, 1], [11, 15], [15, 17, 19], [13, 14, 4], [18, 10], [20, 14], [16, 6], [14, 12], [10, 17], []], [[2], [1, 3], [2, 4, 17, 15], [3, 5], [4, 6], [5, 7], [6, 8, 8, 13], [7, 9], [8, 10], [], [14, 12], [11, 20], [7, 20], [19, 11], [3, 10], [19], [3, 19], [10, 20], [17, 14, 16], [18, 13, 12], []], [[2, 18], [1, 11, 3], [2, 4], [3, 5, 14], [11, 6, 4], [5, 13, 7], [6, 13, 8], [7, 19, 9], [10, 8], [], [2, 20, 5], [13, 16, 17], [20, 12, 7], [4, 10], [10, 7], [12, 19], [18, 12], [17, 20, 1], [8, 16], [11, 18, 13], []], [[2], [1, 11, 14, 3], [2, 13, 4], [3, 5], [4, 6], [18, 5, 7], [8, 6, 17], [12, 9, 7], [16, 10, 8], [], [20], [8, 19], [3, 10], [2, 2, 10], [19, 17], [20, 9], [7, 15], [10, 6], [12, 15], [11, 16], []], [[2], [3, 20, 1], [4, 2], [11, 10, 3, 5], [6, 4], [7, 5], [8, 6], [16, 9, 7], [8, 10], [], [18, 4], [14, 18], [19, 20], [15, 17, 12], [16, 14], [15, 8], [14, 19], [12, 11], [17, 13], [2, 13], []]]
  45. end
  46.  
  47. on initmap
  48.   global foillist, route, mainlist, hord, hordlink, linklist, game8level
  49.   set hordlink to getAt(linklist, route)
  50.   set hord to getAt(foillist, route)
  51.   initmainlist()
  52.   set numcast to the number of cast "num1" - 1
  53.   set tablecast to the number of cast "dig1" - 1
  54.   puppetSprite(36, 1)
  55.   repeat with xxx = 1 to 10
  56.     puppetSprite(xxx + 36, 1)
  57.     set the castNum of sprite (xxx + 36) to getAt(mainlist, xxx) + tablecast
  58.   end repeat
  59.   repeat with xxx = 1 to 20
  60.     puppetSprite(xxx + 1, 1)
  61.     if getAt(hord, xxx) > 0 then
  62.       set the castNum of sprite (xxx + 1) to numcast + getAt(mainlist, getAt(hord, xxx))
  63.       next repeat
  64.     end if
  65.     set stink to getAt(mainlist, abs(getAt(hord, xxx)))
  66.     set stunk to random(10)
  67.     if game8level < 3 then
  68.       repeat while stink = stunk
  69.         set stunk to random(10)
  70.       end repeat
  71.     else
  72.       repeat while getPos(mainlist, stunk) > 0
  73.         set stunk to random(10)
  74.       end repeat
  75.     end if
  76.     if stunk > 10 then
  77.       set stunk to stink - 1
  78.     end if
  79.     set the castNum of sprite (xxx + 1) to numcast + stunk
  80.   end repeat
  81. end
  82.  
  83. on initmainlist
  84.   global game8level, mainlist
  85.   set mainlist to []
  86.   if game8level < 1 then
  87.     set game8level to 1
  88.   end if
  89.   if game8level = 1 then
  90.     set stung to random(10)
  91.     repeat with xxx = 1 to 10
  92.       add(mainlist, stung)
  93.     end repeat
  94.   end if
  95.   if game8level = 2 then
  96.     set oddeven to random(3) - 1
  97.     if oddeven = 0 then
  98.       set mainlist to [2, 4, 6, 8, 10, 2, 4, 6, 8, 10]
  99.     else
  100.       if oddeven = 1 then
  101.         set mainlist to [1, 3, 5, 7, 9, 1, 3, 5, 7, 9]
  102.       else
  103.         set mainlist to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  104.       end if
  105.     end if
  106.   end if
  107.   if game8level = 3 then
  108.     set pattern1 to random(10)
  109.     set pattern2 to random(10)
  110.     if pattern2 = pattern1 then
  111.       set pattern2 to pattern2 + 1
  112.       if pattern2 > 10 then
  113.         set pattern2 to 1
  114.       end if
  115.     end if
  116.     repeat with xxx = 1 to 5
  117.       add(mainlist, pattern1)
  118.       add(mainlist, pattern2)
  119.     end repeat
  120.   end if
  121. end
  122.